home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / elv18src.zip / vars.c < prev    next >
C/C++ Source or Header  |  1993-09-20  |  4KB  |  119 lines

  1. /* vars.c */
  2.  
  3. /* Author:
  4.  *    Steve Kirkendall
  5.  *    14407 SW Teal Blvd. #C
  6.  *    Beaverton, OR 97005
  7.  *    kirkenda@cs.pdx.edu
  8.  */
  9.  
  10.  
  11. /* This file contains variables which weren't happy anyplace else */
  12.  
  13. #include "config.h"
  14. #include "vi.h"
  15.  
  16. /*------------------------------------------------------------------------*/
  17.  
  18. /* used to remember whether the file has been modified */
  19. struct _viflags    viflags;
  20.  
  21. /* used to access the tmp file */
  22. long        lnum[MAXBLKS];
  23. long        nlines;
  24. int        tmpfd = -1;
  25. int        tmpnum;
  26.  
  27. /* used to keep track of the current file & alternate file */
  28. long        origtime;
  29. char        origname[256];
  30. char        prevorig[256];
  31. long        prevline = 1;
  32.  
  33. /* used to track various places in the text */
  34. MARK        mark[NMARKS];    /* marks 'a through 'z, plus mark '' */
  35. MARK        cursor;        /* the cursor position within the file */
  36.  
  37. /* which mode of the editor we're in */
  38. int        mode;        /* vi mode? ex mode? quitting? */
  39.  
  40. /* used to manage the args list */
  41. char        args[BLKSIZE];    /* list of filenames to edit */
  42. int        argno;        /* index of current file in args list */
  43. int        nargs;        /* number of filenames in args[] */
  44.  
  45. /* dummy var, never explicitly referenced */
  46. int        bavar;        /* used only in BeforeAfter macros */
  47.  
  48. /* used to detect changes that invalidate cached text/blocks */
  49. long        changes;    /* incremented when file is changed */
  50. int        significant;    /* boolean: was a *REAL* change made? */
  51. int        exitcode = 1;    /* 0=overwritten, 1=not updated, else error */
  52.  
  53. /* used to support the pfetch() macro */
  54. int        plen;        /* length of the line */
  55. long        pline;        /* line number that len refers to */
  56. long        pchgs;        /* "changes" level that len refers to */
  57. char        *ptext;        /* text of previous line, if valid */
  58.  
  59. /* misc temporary storage - mostly for strings */
  60. BLK        tmpblk;        /* a block used to accumulate changes */
  61.  
  62. /* screen oriented stuff */
  63. long        topline;    /* file line number of top line */
  64. int        leftcol;    /* column number of left col */
  65. int        physcol;    /* physical column number that cursor is on */
  66. int        physrow;    /* physical row number that cursor is on */
  67.  
  68. /* used to help minimize that "[Hit a key to continue]" message */
  69. int        exwrote;    /* Boolean: was the last ex command wordy? */
  70.  
  71. /* This variable affects the behaviour of certain functions -- most importantly
  72.  * the input function.
  73.  */
  74. int        doingdot;    /* boolean: are we doing the "." command? */
  75.  
  76. /* This variable affects the behaviour of the ":s" command, and it is also
  77.  * used to detect & prohibit nesting of ":g" commands
  78.  */
  79. int        doingglobal;    /* boolean: are doing a ":g" command? */
  80.  
  81. /* This variable is zeroed before a command executes, and later ORed with the
  82.  * command's flags after the command has been executed.  It is used to force
  83.  * certain flags to be TRUE for *some* invocations of a particular command.
  84.  * For example, "/regexp/+offset" forces the LNMD flag, and sometimes a "p"
  85.  * or "P" command will force FRNT.
  86.  */
  87. int        force_flags;
  88.  
  89. /* These are used for reporting multi-line changes to the user */
  90. long        rptlines;    /* number of lines affected by a command */
  91. char        *rptlabel;    /* description of how lines were affected */
  92.  
  93. /* These store info that pertains to the shift-U command */
  94. long    U_line;            /* line# of the undoable line, or 0l for none */
  95. char    U_text[BLKSIZE];    /* contents of the undoable line */
  96.  
  97.  
  98. #ifndef NO_VISIBLE
  99. /* These are used to implement the 'v' and 'V' commands */
  100. MARK    V_from;            /* starting point for v or V */
  101. int    V_linemd;        /* boolean: doing line-mode version? (V, not v) */
  102. #endif
  103.  
  104. #ifndef NO_LEARN
  105. /* This is used by the "learn" mode */
  106. char    learn;            /* name of buffer being learned */
  107. #endif
  108.  
  109. /* Bigger stack req'ed for TOS and TURBOC */
  110.  
  111. #if TOS
  112. long    _stksize = 16384;
  113. #endif
  114.  
  115. #if TURBOC
  116. #include <dos.h>
  117. extern unsigned _stklen = 16384U;
  118. #endif
  119.